package com.xzm.MQ.workqueue;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.xzm.MQ.utils.RabbitMQUtils;

import java.io.IOException;

public class Provider {
    public static void main(String[] args) throws IOException {
        Connection connection = RabbitMQUtils.getConnection();
        Channel channel = connection.createChannel();
        channel.queueDeclare("work",true,false,false,null);
        for(int i=0;i<10;i++){
            channel.basicPublish("", "work", null, (i+"====>:我是消息").getBytes());
        }
        RabbitMQUtils.closeChannelAndConnetion(channel,connection);
    }
}
